package business;

import java.util.Calendar;
import java.util.Date;

import utils.Utils;

public class Company {
	
	private static final String ATT_PROVINCIA = "provincia";
	private static final String ATT_PDO = "pdo";
	private static final String ATT_CUIT = "cuit";
	private static final String ATT_RAZON_SOCIAL = "razon_social";
	private static final String ATT_CALLE = "calle";
	private static final String ATT_NUMERO = "numero";
	private static final String ATT_PISO = "piso";
	private static final String ATT_OFICINA = "oficina";
	private static final String ATT_ZIP = "zip";
	private static final String ATT_MUNICIPIO = "ciudad";
	private static final String ATT_DPTO = "dpto";
	private static final String ATT_TELEFONO = "telefono";
	private static final String ATT_FAX = "fax";
	private static final String ATT_WEB = "web";
	private static final String ATT_FORMA_JURIDICA = "forma_juridica";
	private static final String ATT_FECHA_INICIO = "fecha_inicio";
	public static final String ATT_FECHA_CIERRE = "fecha_cierre";
	private static final String ATT_MES_CIERRE = "mes_cierre_act";
	private static final String ATT_ANO_CIERRE = "ano_cierre_act";
	private static final String ATT_MES_INICIO = "mes_inicio_act";	
	private static final String ATT_GRUPO_ECO_BOOLEAN = "grupo_eco_Boolean";
	private static final String ATT_GRUPO_ECO = "grupo_eco";
	private static final String ATT_ACTIVITY = "actividad";
	private static final String ATT_CLANAE_04 = "clanae_2004";
	private static final String ATT_CLANAE_10 = "clanae_2010";
	
	public static final String VAR_7_1_2_1 = "E~7.1.2.1";
	
	private Long id;
	private String cuit;
	private String nCuit;
	private String businessName;
	private String confirm;
	private String confirmD;
	private String confirmRS;
	private String businessNameN;
	private String fantasyName;
	private Long statusID;
	private String street;
	private String number;
	private String flat;
	private String office;
	private String zipCode;
	private Province province;
	private State state;
	private City city;
	private String telephoneNumber;
	private String faxNumber;
	private String webPage;
	private String email;
	private String streetN;
	private String numberN;
	private String flatN;
	private String officeN;
	private String zipCodeN;
	private Province provinceN;
	private State stateN;
	private City cityN;
	private String telephoneNumberN;
	private String faxNumberN;
	private String webPageN;
	private String emailN;
//	private String responsibleLegName;
//	private String responsibleLegRole;
//	private String responsibleLegEmail;
	private LegalForm legalForm;
	private Date startDate;
	private Date endDate;
	private boolean issueFinancialStatement;
	private Date endExerciseMonth;	
	private String groupEco;
	private String groupName;
	private boolean foreignPart;
	private String investorCountry;
//	private Date sendLetterDate;
//	private Date webAcceptDate;
//	private Date expirationAcredDate;
//	private Date receptionAcredDate;
//	private Date expirationEmpadDate;
//	private String responsibleName;
//	private String responsibleRole;
//	private String responsibleEmail;
//	private String responsibleTelephone;
//	private String remitterName;
//	private String remitterRole;
//	private String remitterEmail;
//	private String remitterTelephone;
//	private String companyObservations;
//	private String contactObservations;
//	private Date createDate;
	private Long asignedTo;
	private User user;
//	private String status;
	private Long restructuring;
//	private String chargeWay;
	private String clanae04;
	private String clanae10;
	private String activity;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getCuit() {
		return cuit;
	}
	public void setCuit(String cuit) {
		this.cuit = cuit;
	}
	public String getnCuit() {
		return nCuit;
	}
	public void setnCuit(String nCuit) {
		this.nCuit = nCuit;
	}
	public String getBusinessName() {
		return businessName;
	}
	public void setBusinessName(String businessName) {
		this.businessName = businessName;
	}
	public String getConfirm() {
		return confirm;
	}
	public void setConfirm(String confirm) {
		this.confirm = confirm;
	}
	public String getConfirmD() {
		return confirmD;
	}
	public void setConfirmD(String confirmD) {
		this.confirmD = confirmD;
	}
	public String getConfirmRS() {
		return confirmRS;
	}
	public void setConfirmRS(String confirmRS) {
		this.confirmRS = confirmRS;
	}
	public String getBusinessNameN() {
		return businessNameN;
	}
	public void setBusinessNameN(String businessNameN) {
		this.businessNameN = businessNameN;
	}
	public String getFantasyName() {
		return fantasyName;
	}
	public void setFantasyName(String fantasyName) {
		this.fantasyName = fantasyName;
	}
	public Long getStatusID() {
		return statusID;
	}
	public void setStatusID(Long statusID) {
		this.statusID = statusID;
	}
	public String getStreet() {
		return street;
	}
	public void setStreet(String street) {
		this.street = street;
	}
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public String getFlat() {
		return flat;
	}
	public void setFlat(String flat) {
		this.flat = flat;
	}
	public String getOffice() {
		return office;
	}
	public void setOffice(String office) {
		this.office = office;
	}
	public String getZipCode() {
		return zipCode;
	}
	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}
	public Province getProvince() {
		return province;
	}
	public void setProvince(Province province) {
		this.province = province;
	}
	public State getState() {
		return state;
	}
	public void setState(State state) {
		this.state = state;
	}
	public City getCity() {
		return city;
	}
	public void setCity(City city) {
		this.city = city;
	}
	public String getTelephoneNumber() {
		return telephoneNumber;
	}
	public void setTelephoneNumber(String telephoneNumber) {
		this.telephoneNumber = telephoneNumber;
	}
	public String getFaxNumber() {
		return faxNumber;
	}
	public void setFaxNumber(String faxNumber) {
		this.faxNumber = faxNumber;
	}
	public String getWebPage() {
		return webPage;
	}
	public void setWebPage(String webPage) {
		this.webPage = webPage;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getStreetN() {
		return streetN;
	}
	public void setStreetN(String streetN) {
		this.streetN = streetN;
	}
	public String getNumberN() {
		return numberN;
	}
	public void setNumberN(String numberN) {
		this.numberN = numberN;
	}
	public String getFlatN() {
		return flatN;
	}
	public void setFlatN(String flatN) {
		this.flatN = flatN;
	}
	public String getOfficeN() {
		return officeN;
	}
	public void setOfficeN(String officeN) {
		this.officeN = officeN;
	}
	public String getZipCodeN() {
		return zipCodeN;
	}
	public void setZipCodeN(String zipCodeN) {
		this.zipCodeN = zipCodeN;
	}
	public Province getProvinceN() {
		return provinceN;
	}
	public void setProvinceN(Province provinceN) {
		this.provinceN = provinceN;
	}
	public State getStateN() {
		return stateN;
	}
	public void setStateN(State stateN) {
		this.stateN = stateN;
	}
	public City getCityN() {
		return cityN;
	}
	public void setCityN(City cityN) {
		this.cityN = cityN;
	}
	public String getTelephoneNumberN() {
		return telephoneNumberN;
	}
	public void setTelephoneNumberN(String telephoneNumberN) {
		this.telephoneNumberN = telephoneNumberN;
	}
	public String getFaxNumberN() {
		return faxNumberN;
	}
	public void setFaxNumberN(String faxNumberN) {
		this.faxNumberN = faxNumberN;
	}
	public String getWebPageN() {
		return webPageN;
	}
	public void setWebPageN(String webPageN) {
		this.webPageN = webPageN;
	}
	public String getEmailN() {
		return emailN;
	}
	public void setEmailN(String emailN) {
		this.emailN = emailN;
	}
//	public String getResponsibleLegName() {
//		return responsibleLegName;
//	}
//	public void setResponsibleLegName(String responsibleLegName) {
//		this.responsibleLegName = responsibleLegName;
//	}
//	public String getResponsibleLegRole() {
//		return responsibleLegRole;
//	}
//	public void setResponsibleLegRole(String responsibleLegRole) {
//		this.responsibleLegRole = responsibleLegRole;
//	}
//	public String getResponsibleLegEmail() {
//		return responsibleLegEmail;
//	}
//	public void setResponsibleLegEmail(String responsibleLegEmail) {
//		this.responsibleLegEmail = responsibleLegEmail;
//	}
	public LegalForm getLegalForm() {
		return legalForm;
	}
	public void setLegalForm(LegalForm legalForm) {
		this.legalForm = legalForm;
	}
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	public boolean isIssueFinancialStatement() {
		return issueFinancialStatement;
	}
	public void setIssueFinancialStatement(boolean issueFinancialStatement) {
		this.issueFinancialStatement = issueFinancialStatement;
	}
	public Date getEndExerciseMonth() {
		return endExerciseMonth;
	}
	public void setEndExerciseMonth(Date endExerciseMonth) {
		this.endExerciseMonth = endExerciseMonth;
	}
	public String getGroupEco() {
		return groupEco;
	}
	public void setGroupEco(String groupEco) {
		this.groupEco = groupEco;
	}
	public String getGroupName() {
		return groupName;
	}
	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
	public boolean isForeignPart() {
		return foreignPart;
	}
	public void setForeignPart(boolean foreignPart) {
		this.foreignPart = foreignPart;
	}
	public String getInvestorCountry() {
		return investorCountry;
	}
	public void setInvestorCountry(String investorCountry) {
		this.investorCountry = investorCountry;
	}
//	public Date getSendLetterDate() {
//		return sendLetterDate;
//	}
//	public void setSendLetterDate(Date sendLetterDate) {
//		this.sendLetterDate = sendLetterDate;
//	}
//	public Date getWebAcceptDate() {
//		return webAcceptDate;
//	}
//	public void setWebAcceptDate(Date webAcceptDate) {
//		this.webAcceptDate = webAcceptDate;
//	}
//	public Date getExpirationAcredDate() {
//		return expirationAcredDate;
//	}
//	public void setExpirationAcredDate(Date expirationAcredDate) {
//		this.expirationAcredDate = expirationAcredDate;
//	}
//	public Date getReceptionAcredDate() {
//		return receptionAcredDate;
//	}
//	public void setReceptionAcredDate(Date receptionAcredDate) {
//		this.receptionAcredDate = receptionAcredDate;
//	}
//	public Date getExpirationEmpadDate() {
//		return expirationEmpadDate;
//	}
//	public void setExpirationEmpadDate(Date expirationEmpadDate) {
//		this.expirationEmpadDate = expirationEmpadDate;
//	}
//	public String getResponsibleName() {
//		return responsibleName;
//	}
//	public void setResponsibleName(String responsibleName) {
//		this.responsibleName = responsibleName;
//	}
//	public String getResponsibleRole() {
//		return responsibleRole;
//	}
//	public void setResponsibleRole(String responsibleRole) {
//		this.responsibleRole = responsibleRole;
//	}
//	public String getResponsibleEmail() {
//		return responsibleEmail;
//	}
//	public void setResponsibleEmail(String responsibleEmail) {
//		this.responsibleEmail = responsibleEmail;
//	}
//	public String getResponsibleTelephone() {
//		return responsibleTelephone;
//	}
//	public void setResponsibleTelephone(String responsibleTelephone) {
//		this.responsibleTelephone = responsibleTelephone;
//	}
//	public String getRemitterName() {
//		return remitterName;
//	}
//	public void setRemitterName(String remitterName) {
//		this.remitterName = remitterName;
//	}
//	public String getRemitterRole() {
//		return remitterRole;
//	}
//	public void setRemitterRole(String remitterRole) {
//		this.remitterRole = remitterRole;
//	}
//	public String getRemitterEmail() {
//		return remitterEmail;
//	}
//	public void setRemitterEmail(String remitterEmail) {
//		this.remitterEmail = remitterEmail;
//	}
//	public String getRemitterTelephone() {
//		return remitterTelephone;
//	}
//	public void setRemitterTelephone(String remitterTelephone) {
//		this.remitterTelephone = remitterTelephone;
//	}
//	public String getCompanyObservations() {
//		return companyObservations;
//	}
//	public void setCompanyObservations(String companyObservations) {
//		this.companyObservations = companyObservations;
//	}
//	public String getContactObservations() {
//		return contactObservations;
//	}
//	public void setContactObservations(String contactObservations) {
//		this.contactObservations = contactObservations;
//	}
//	public Date getCreateDate() {
//		return createDate;
//	}
//	public void setCreateDate(Date createDate) {
//		this.createDate = createDate;
//	}
	public Long getAsignedTo() {
		return asignedTo;
	}
	public void setAsignedTo(Long asignedTo) {
		this.asignedTo = asignedTo;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
//	public String getStatus() {
//		return status;
//	}
//	public void setStatus(String status) {
//		this.status = status;
//	}
	public Long getRestructuring() {
		return restructuring;
	}
	public void setRestructuring(Long restructuring) {
		this.restructuring = restructuring;
	}
//	public String getChargeWay() {
//		return chargeWay;
//	}
//	public void setChargeWay(String chargeWay) {
//		this.chargeWay = chargeWay;
//	}
		
	public String getClanae04() {
		return clanae04;
	}
	public void setClanae04(String clanae04) {
		this.clanae04 = clanae04;
	}
	public String getClanae10() {
		return clanae10;
	}
	public void setClanae10(String clanae10) {
		this.clanae10 = clanae10;
	}
	public String getActivity() {
		return activity;
	}
	public void setActivity(String activity) {
		this.activity = activity;
	}
	public String getAttribute2(String attName)
	{
		return null;
	}
	public String getAttribute(String attName)
	{
		if (attName.equals(ATT_PROVINCIA)) {
			if(getProvince() != null)
			{
				return getProvince().getProvince();
			}			
		} else if (attName.equals(ATT_PDO)) {
			if(getState() != null)
			{
				return getState().getDescription();
			}
		} else if (attName.equals(ATT_CUIT)) {
			return getCuit();
		} else if (attName.equals(ATT_RAZON_SOCIAL)) {
			return getBusinessName();
		} else if (attName.equals(ATT_CALLE)) {
			return getStreet();
		} else if (attName.equals(ATT_NUMERO)) {
			return String.valueOf(getNumber());
		} else if (attName.equals(ATT_PISO)) {
			return getFlat();
		} else if (attName.equals(ATT_OFICINA)) {
			return getOffice();
		} else if (attName.equals(ATT_ZIP)) {
			return getZipCode();
		} else if (attName.equals(ATT_MUNICIPIO)) {
			if(getCity() != null)
			{
				return getCity().getCity();	
			}			
		} else if (attName.equals(ATT_DPTO)) {
			if(getState() != null)
			{
				return getState().getDescription();
			}
		} else if (attName.equals(ATT_TELEFONO)) {
			return getTelephoneNumber();
		} else if (attName.equals(ATT_FAX)) {
			return getFaxNumber();
		} else if (attName.equals(ATT_WEB)) {
			return getWebPage();
		} else if (attName.equals(ATT_FORMA_JURIDICA)) {
			if(getLegalForm() != null)
			{
				return getLegalForm().getDescription();	
			}			
		} else if (attName.equals(ATT_FECHA_INICIO)) {
			if(getStartDate() != null)
			{
				return Utils.convertDateWithoutTimeToString(getStartDate());
			}				
		} else if (attName.equals(ATT_FECHA_CIERRE)) {
			if(getEndExerciseMonth() != null)
			{
				return Utils.convertDateWithoutTimeToString(getEndExerciseMonth()) ;
			}
			
		} else if (attName.equals(ATT_MES_INICIO)) {
			if(getStartDate() != null)
			{
				Calendar ca1 = Calendar.getInstance();
				ca1.setTime(getStartDate());
				return String.valueOf(ca1.get(Calendar.MONTH));
			}
		} else if (attName.equals(ATT_MES_CIERRE)) {
			if(getEndExerciseMonth() != null)
			{
				Calendar ca1 = Calendar.getInstance();
				ca1.setTime(getEndExerciseMonth());
				Integer mes= ca1.get(Calendar.MONTH) +1;
				return String.valueOf(mes);
			}
			
		} else if (attName.equals(ATT_ANO_CIERRE)) {
			if(getEndExerciseMonth() != null)
			{
				Calendar ca1 = Calendar.getInstance();
				ca1.setTime(getEndExerciseMonth());
				return String.valueOf(ca1.get(Calendar.YEAR));
			}
			
		}else if (attName.equals(ATT_GRUPO_ECO_BOOLEAN)) {
			if(getGroupEco() != null && getGroupEco().trim().length() > 0)
			{
				return "SI";
			}
			else
			{
				return "NO";
			}
		} else if (attName.equals(ATT_GRUPO_ECO)) {
			return getGroupName();
		} else if (attName.equals(ATT_CLANAE_04)) {
			return getClanae04();
		} else if (attName.equals(ATT_CLANAE_10)) {
			return getClanae10();
		} else if (attName.equals(ATT_ACTIVITY)) {
			return getActivity();
		}
		
		
		return null;
	}

}
